import {networkConfig} from '../helper-hardhat-config'
const { network,devlopmentChains } = require("hardhat")
module.exports= async({getNamedAccounts, deployments}) => {
    const {firstAccount} = await getNamedAccounts()
    const {deploy} = deployments

    let dataFeedAddr
    if(devlopmentChains.includes(network.name)) {
        const mockV3Aggregator = await deployments.get("MockV3AggregatorETH")
        dataFeedAddr = mockV3Aggregator.address
    } else {
        dataFeedAddr = networkConfig[network.config.chainId].ethUsdDataFeed
    }

    await deploy("NFTUUDSMarket", {
        from: firstAccount,
        args: [dataFeedAddr],
        log: true
    })
}

module.exports.tags = ["all",  "auction"]